<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改任务')" />
    <th:block th:include="include :: header('表单构建器')" />
    <th:block th:include="include :: header('功能扩展')" />
    <th:block th:include="include :: header('文件上传')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
    <th:block th:include="include :: jasny-bootstrap-css" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-taskMission-edit" th:object="${taskMission}" enctype="multipart/form-data">
        <input id="missionId" name="missionId" type="hidden" th:field="*{missionId}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label">任务标题：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="missionTitle" id="missionTitle" th:field="${taskMission.missionTitle}" required readonly="teue">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">任务内容：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="missionText" id="missionText" th:field="${taskMission.missionText}" required  readonly="teue">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label ">完成时间：</label>
            <div class="col-sm-4">
                <input class="form-control" type="datetime-local" name="createTime" id="createTime"  th:value="${#dates.format(taskMission.createTime,'yyyy-MM-dd')}+'T'+${#dates.format(taskMission.createTime,'HH:mm:ss')}" required  readonly="teue">
            </div>
            <div class="col-sm-4">
                <input class="form-control" type="datetime-local" name="endTime" id="endTime" th:value="${#dates.format(taskMission.endTime,'yyyy-MM-dd')}+'T'+${#dates.format(taskMission.endTime,'HH:mm:ss')}" required step="1"  readonly="teue">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">紧急程度：</label>
            <div class="col-sm-9">

                <label class="radio-box">
                    <input type="radio"
                           th:checked="${taskMission.urgencyLevel eq '0'}"
                           id="optionsRadios1" name="urgencyLevel" value="0" style="position: absolute; opacity: 0;"  readonly="teue">
                    普通
                </label>

                <label class="radio-box">
                    <input type="radio"
                           th:checked="${taskMission.urgencyLevel eq '1'}"
                           id="option2" name="urgencyLevel"  value="1" style="position: absolute; opacity: 0;"  readonly="teue">
                    紧急
                </label>

                <label class="radio-box">

                    <input type="radio"
                           th:checked="${taskMission.urgencyLevel eq '2'}"
                           id="option3" name="urgencyLevel"  value="2" style="position: absolute; opacity: 0;"  readonly="teue">
                    非常紧急
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">执行人员：</label>
            <div class="col-sm-8">
                <select name="infoId"  class="form-control" id="infoId">
                    <option>请选择执行人</option>
                    <option th:each="person : ${list}" th:value="${person.infoId}" th:text="${person.infoName}" th:selected="${person.infoId eq taskMission.infoId}"  readonly="teue"></option>
                </select>
            </div>
        </div>

        <div class="form-group draggable">
            <label class="col-sm-3 control-label">单选框：
            </label>

            <div class="col-sm-8">
                <label class="radio-box">
                    <input type="radio"
                           th:checked="${taskMission.status eq '1'}"
                           id="optionsRadios" name="status" value="1" style="position: absolute; opacity: 0;"  readonly="teue">
                    完成
                </label>
                <label class="radio-box">
                    <input type="radio"
                           th:checked="${taskMission.status eq '0'}"
                           id="optionsRadios2" name="status" value="0" style="position: absolute; opacity: 0;"  readonly="teue">
                    没完成
                </label>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">

                    <div class="ibox-content">


                        <div class="form-group">
                            <label class="font-noraml">成果上传</label>
                            <div class="file-loading">
                                <input id="fileinput-demo-1" type="file" multiple>
                            </div>
                        </div>
                        <hr>

                    </div>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">


    var prefix = ctx + "task/showInfo";

    $("#form-taskMission-edit").validate({
        onkeyup: false,
        focusCleanup: true
    });

    $(document).ready(function () {
        var missionId = $("#missionId").val();
        $("#fileinput-demo-1").fileinput({
            'theme': 'explorer-fas',
            'uploadUrl': '/task/showInfo/addPicture?missionId='+missionId,
            overwriteInitial: false,
            initialPreviewAsData: true,

        });
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-taskMission-edit').serialize());
        }
    }
</script>
<th:block th:include="include :: footer" />
<th:block th:include="include :: jasny-bootstrap-js" />
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js" />
</body>
</html>
